package com.peng.mybatis_framework;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;


//忽略默认配置
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class StartUp {
    public static void main( String[] args ){
    	
    	//设置环境
    	setRuntime();
    	
    	SpringApplication.run(StartUp.class, args);
    }

	private static void setRuntime() {
		String runtime = System.getProperty("env.model");
		if("DEV".equals(runtime)) {
			System.setProperty("spring.profiles.active", "dev");
		}else if ("TEST".equals(runtime)) {
			System.setProperty("spring.profiles.active", "test");
		} else if ("OUTLINE".equals(runtime)) {
			System.setProperty("spring.profiles.active", "outline");
		} else {
			System.setProperty("spring.profiles.active", "dev");
		}
		
	}
    
}
